/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package anotherFrameWork;

/**
 *
 * @author Windows7
 */
public class matrixPoints {
    private int n;
    private int m;
    private point[][] matrix;
    
    public matrixPoints()
    {
        this.n = 10;
        this.m = 10;
        this.matrix = new point[this.n][this.m];
    }
    
    public matrixPoints(int n, int m)
    {
        this.n = n;
        this.m = m;
        this.matrix = new point[n][m];
    }
    
    public matrixPoints(point start, int n, int m, float distance)
    {
        this.n = n;
        this.m = m;
        this.matrix = new point[n][m];
        float x = start.getX();
        float y = start.getY();
        for(int i = 0 ; i < n ; i++)
        {
            for(int j = 0 ; j < m ; j++)
            {
                this.matrix[i][j] = new point(x+j*distance,y+i*distance);
            }
        }
    }
    
    public matrixPoints(matrixPoints mp)
    {
        this.n = mp.n;
        this.m = mp.m;
        this.matrix = new point[this.n][this.m];
        for(int i = 0 ; i < this.n; i++)
        {
            for(int j = 0 ;  j < this.m ; j++)
            {
                this.matrix[i][j] = mp.matrix[n][m];
            }
        }
    }

    /**
     * @return the n
     */
    public int getN() {
        return n;
    }

    /**
     * @param n the n to set
     */
    public void setN(int n) {
        this.n = n;
    }

    /**
     * @return the m
     */
    public int getM() {
        return m;
    }

    /**
     * @param m the m to set
     */
    public void setM(int m) {
        this.m = m;
    }

    /**
     * @return the matrix
     */
    public point[][] getMatrix() {
        return matrix;
    }
    
    public point getFromXY(int x, int y)
    {
        return this.matrix[x][y];
    }

}
